<?php

/*
 * 查自己的错题列表接口
 * uid
 * 
 * 
 * 返回json数据
 * 
 * */
 	//引入php文件
 	include 'connect-sql.php';
 
	$wqid= $_GET['wqid'];
	
	
	//连接数据库
	$link = connectSql();
	
	$query = "SELECT * FROM wqs  WHERE wqs.id = '$wqid'";
	
	//执行sql
	$res = mysqli_query($link, $query);
	//var_dump($res);
	$newArr = [];
	while($row = mysqli_fetch_array($res, MYSQL_ASSOC)){
		array_push($newArr,$row);
	}
	
	
	
	//var_dump($row);
	$arr = array();
	
	if($res->num_rows){
		$arr['code'] = 1;
		$arr['data'] = $newArr;
	}else{
		$arr['code'] = 0;
	}
	
	
	//token  (jwt)asdf9as7df9a87sdf9aa7sd9
	
	
	echo json_encode($arr);
	
?>